#include "tcpmanager.h"
#include "config.h"
#include <iostream>

using namespace std;

TcpManager* TcpManager::instance = NULL;

TcpManager::TcpManager() {
    log->print("try to open Server");
    this->listen(QHostAddress::Any, config::getPort());
}

TcpManager::~TcpManager() {
    this->close();
    log->print("closing Server");
}

TcpManager* TcpManager::getInstance() {
    if (TcpManager::instance == NULL) {
        TcpManager::instance = new TcpManager();
    }
    return TcpManager::instance;
}


void TcpManager::incomingConnection(int socketDescriptor) {
    // TODO
}



